<input type="text" class="layui-input" name="<?php echo $name; ?>" id="<?php echo isset($id) ? $id : $name ?>" placeholder="" value="<?php echo isset($value)?$value:''?>">
<script>
    layui.use(function() {

        var laydate = layui.laydate;


        <?php
        $type = "date";
        switch ($polymorphic) {
            case 1:
                $type = "date";
                break;
            case 2:
                $type = "time";
                break;
            case 3:
                $type = "year";
                break;
            case 4:
                $type = "month";
                break;
            case 5:
                $type = "datetime";
                break;
        }

        ?>

        var type = '<?php echo $type ?>';
        // 年选择器
        laydate.render({
            elem: '#<?php echo isset($id) ? $id : $name ?>',
            type: type,
            fullPanel: true
        });


    });
</script>